//
//  CCHttp+cate.m
//  HaiYue
//
//  Created by tucici on 2019/4/10.
//  Copyright © 2019 skyline. All rights reserved.
//

#import "CCHttp+cate.h"

@implementation CCHttp (cate)
- (NSMutableDictionary *)basicPara
{
    return [NSMutableDictionary dictionaryWithDictionary:@{@"terminal":@"1",
                                    @"accesstoken":[[HYUserManager manager].user.accesstoken length] > 1?[HYUserManager manager].user.accesstoken:@""}];
}

+ (BOOL)shouldReturnWithResponse:(id)response
{
    int code = [[response valueForKey:@"retcode"] intValue];
    
    if (code == 2002)
    {
        [CCAlert showMessage:@"登录超时" hidden:^{
            UIViewController *vc = [UIViewController presentedViewController:nil];
            if (vc)
            {
                [vc.navigationController pushViewController:[NSClassFromString(@"HYLoginViewController") new] animated:YES];
            }
        }];
        return YES;
    }
    return NO;
}
@end
